/*
 * DigaltalLogicRelay.cpp
 *
 *  Created on: 2012. 10. 16.
 *      Author: dalxx
 */
#include <Arduino.h>
#include "DigitalLogicRelay.h"

namespace PLCLib {

DigitalLogicRelay::DigitalLogicRelay(const char* _name):Relay(_name)
{
	this->pcalculator=NULL;
}



DigitalLogicRelay::~DigitalLogicRelay() {
	if(this->pcalculator!=NULL)
		delete this->pcalculator;

}

void DigitalLogicRelay::SetCalculator(BooleanCalculator* pcal) {
	this->pcalculator=pcal;
}

bool DigitalLogicRelay::CalculateNext() {
	this->next_status=this->pcalculator->Calculate();
	return this->next_status;
}

} /* namespace PLCLib */
